import React, {PropsWithChildren} from 'react'
import {View} from "@tarojs/components";
import "./ListItem.sass"

export interface ListItemProps extends PropsWithChildren {
  title:React.ReactNode
  tail?:React.ReactNode
  content?:React.ReactNode
}

const ListItem: React.FC<ListItemProps> = (props) => {
  return <>
    <View className={"list-item"}>
      <View className={"list-item_header"}>
        <View className={"list-item_title-wrapper"}>{props.title}</View>
        {props.tail&&<View className={"list-item_tail-wrapper"}>{props.tail}</View>}
      </View>
      {props.content && <View className={"list-item_content-wrapper"}>
        {props.content}
      </View>}
    </View>
  </>
}

export default ListItem


